#!/bin/bash

version_alpine="3.20"
subVersion="3"
packName="alpine-minirootfs-${version_alpine}.${subVersion}-x86_64.tar.gz"
dlurl="https://mirrors.ustc.edu.cn/alpine/v${version_alpine}/releases/x86_64/${packName}"
packDir="pack"
imgDir="alpine-minirootfs"

if [ ! -d "${packDir}" ]; then
	mkdir "${packDir}"
fi
if [ ! -d "${imgDir}" ]; then
	mkdir "${imgDir}"
fi

echo "正在下载 alpine v${version_alpine} 到 ${packDir}"
wget -O "${packDir}/${packName}" "${dlurl}"

# tar -xzf "${packDir}/${packName}" -C "${imgDir}"
cp "${packDir}/${packName}" ./alpine-minirootfs.tar.gz
